package org.kl.bf.repository.basic;

import java.util.List;

import org.kl.bf.entity.basic.Sessions;
import org.kl.bf.repository.BasicRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

public interface SessionsDao extends BasicRepository<Sessions, String>, JpaSpecificationExecutor<Sessions> {
	@Modifying
	@Query("update Sessions a set a.sessionSerialize = ?1 where a.sessionId = ?2")
	public int updateSessionSerialize(String sessionSerialize, String sessionId);

	@Modifying
	@Query("delete from  Sessions a where a.sessionId = ?1")
	public int deleteBySessionId(String sessionId);

	List<Sessions> findBySessionId(String sessionId);
}
